/**
 * Copyright 20011-2013 Brin.com
 * All rights reserved.
 * 
 * @project
 * @author Brin
 * @version 1.0
 * @data 2013-06-18
 */
package com.brin.code.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.brin.code.dao.SampleMapper;
import com.brin.code.model.pojo.Sample;
import com.brin.code.model.vo.SampleVO;
import com.brin.code.service.SampleService;
import com.brin.core.base.service.BaseService;
import com.google.code.ssm.api.ParameterValueKeyProvider;
import com.google.code.ssm.api.ReadThroughSingleCache;

/**
 * 
 * @author Brin
 * @description SampleServiceImpl
 * 
 */

@Service
public class SampleServiceImpl extends BaseService implements SampleService {

	private static final String NAMESPACE = "com.brin.code.dao.Sample";
	
	@Override
	public List<SampleVO> querySampleList(Sample sample) {
		return sampleMapper.querySampleList(sample);
	}
	
	public int queryCountSample(){
		return sampleMapper.queryCountSample();
	}
	
	@ReadThroughSingleCache(namespace = NAMESPACE, expiration = 600)
	public SampleVO querySampleById(@ParameterValueKeyProvider int id){
		return sampleMapper.querySampleById(id);
	}
	
	@Autowired
	private SampleMapper sampleMapper;

	public SampleMapper getSampleMapper() {
		return sampleMapper;
	}
	public void setSampleMapper(SampleMapper sampleMapper) {
		this.sampleMapper = sampleMapper;
	}
}
